package cn.wen.yinxiu.works.dao;

import cn.wen.yinxiu.works.entity.WorksDataEntity;
import cn.wen.yinxiu.works.vo.WorksDataSimpleVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 *
 * @ClassName: WorksDataDao
 * @Author 小飞
 * @Email coderwen22@163.com
 * @Date 2023-05-21 22:19:26
 * @Description: 数据统计表
 */
@Component
@Mapper
public interface WorksDataDao extends BaseMapper<WorksDataEntity> {

    /**
     * 批量插入
     *
     * @param worksDataList
     * @return
     */
    boolean insertBatch(@Param("worksDataList") List<WorksDataEntity> worksDataList);

    /**
     * 获取周期内的数据
     * @param userId
     * @param filed
     * @param preDateTime
     * @param todayEndTime
     * @return
     */
    List<WorksDataSimpleVO> queryWorksDataByFiled(@Param("userId") Long userId,
                                                  @Param("filed") String filed,
                                                  @Param("startTime") String preDateTime,
                                                  @Param("endTime") String todayEndTime);
}
